
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="../../../global/css/aui.css" />
    <link rel="stylesheet" type="text/css" href="./frm.css" />
</head>
<body>
	<div id="group-manage" data-from=""></div>
</body>

<script id="tpl-group-manage-set_admin" type="text/x-dot-template">
    <div class="aui-content aui-margin-b-15">
        <ul class="aui-list aui-media-list">
        	{{~it :v:i}}
            <li class="aui-list-item aui-list-item-middle" data-uid="{{=v.uid}}" data-role="{{=safeStr(v.role)}}" data-gmid="{{=v.gmid}}" data-owner="{{=safeNum(v.is_owner)}}" data-admin="{{=safeNum(v.is_admin)}}" tapmode onclick="onClickItem4SetAdmin(this);">
                <div class="aui-media-list-item-inner">
                    <div class="aui-list-item-media" style="width: 3rem;">
                        <img class="aui-img-round" src="{{=v.avatar}}" data-type="avatar"/>
                    </div>
                    <div class="aui-list-item-inner">
                        {{=v.username}}
                        <span class="auix-group-role" style="{{? v.role_color}}background-color:{{=v.role_color}}{{?}}">{{=safeStr(v.role)}}</span>
                        <i class="aui-iconfont aui-icon-correct aui-text-success"></i>
                    </div>
                </div>
            </li>
            {{~}}
        </ul>
    </div>
</script>

<script id="tpl-group-manage-set_talk_status" type="text/x-dot-template">
    <div class="aui-content aui-margin-b-15">
        <ul class="aui-list aui-media-list">
        	{{~it :v:i}}
            <li class="aui-list-item aui-list-item-middle" data-uid="{{=v.uid}}" data-role="{{=safeStr(v.role)}}" data-gmid="{{=v.gmid}}" data-owner="{{=safeNum(v.is_owner)}}" data-admin="{{=safeNum(v.is_admin)}}" data-talk="{{=safeNum(v.talk_status)}}" tapmode onclick="onClickItem4SetTalkStatus(this);">
                <div class="aui-media-list-item-inner">
                    <div class="aui-list-item-media" style="width: 3rem;">
                        <img class="aui-img-round" src="{{=v.avatar}}" data-type="avatar"/>
                    </div>
                    <div class="aui-list-item-inner">
                        {{=v.username}}
                        <span class="auix-group-role" style="{{? v.role_color}}background-color:{{=v.role_color}}{{?}}">{{=safeStr(v.role)}}</span>
                        <img class="gag" src="../../../global/image/gag.png"/>
                    </div>
                </div>
            </li>
            {{~}}
        </ul>
    </div>
</script>

<script id="tpl-group-manage-del_member" type="text/x-dot-template">
    <div class="aui-content aui-margin-b-15">
        <ul class="aui-list aui-media-list">
        	{{~it :v:i}}
            <li class="aui-list-item aui-list-item-middle" data-del="0" data-uid="{{=v.uid}}" data-role="{{=safeStr(v.role)}}" data-gmid="{{=v.gmid}}" data-owner="{{=safeNum(v.is_owner)}}" data-admin="{{=safeNum(v.is_admin)}}" tapmode onclick="onClickItem4DelMember(this);">
                <div class="aui-media-list-item-inner">
                    <div class="aui-list-item-media" style="width: 3rem;">
                     <img class="aui-img-round" src="{{=v.avatar}}" data-type="avatar"/>
                    </div>
                    <div class="aui-list-item-inner">
                        {{=v.username}}
                        <span class="auix-group-role" style="{{? v.role_color}}background-color:{{=v.role_color}}{{?}}">{{=safeStr(v.role)}}</span>
                        <i class="aui-iconfont aui-icon-close aui-text-danger"></i>
                    </div>
                </div>
            </li>
            {{~}}
        </ul>
    </div>
</script>

<script type="text/javascript" src="../../../config.js"></script>
<script type="text/javascript" src="../../../global/script/lib/api.js"></script>
<script type="text/javascript" src="../../../global/script/lib/doT.min.js"></script>
<script type="text/javascript" src="../../../global/script/lib/aui-lazyload.js"></script>
<script type="text/javascript" src="../../../global/script/mylib.js"></script>
<script type="text/javascript" src="../../../app.js"></script>

<script type="text/javascript" src="./op/shared.js"></script>
<script type="text/javascript" src="./op/setAdmin.js"></script>
<script type="text/javascript" src="./op/setTalkStatus.js"></script>
<script type="text/javascript" src="./op/delMember.js"></script>
<script type="text/javascript" src="./frm.js"></script>

</html>


<script type="text/javascript" src="../../../global/script/_fakeApi.js"></script>
<script type="text/javascript">
	window.mockGroupMembers = [
	    {
	        uid: "17",
	        is_owner: 1,
	        username: "子牛",
	        avatar: "http://www.ikongji.com/uc_server/images/avatar/avatar_5_middle.gif",
	        role: '师傅',
	        talk_status: 1,
	    },
	    {
	        uid: '0',
	        username: "匿名",
	        avatar: "https://avatar.gitee.com/uploads/0/669200_war1644.png",
	        talk_status: 1,
	    },
	    {
	        uid: '0',
	        username: "匿名",
	        avatar: "https://avatar.gitee.com/uploads/0/669200_war1644.png",
	        talk_status: 0,
	    },
	    {
	        uid: "1",
	        is_admin: 1,
	        username: "admin",
	        role: '管理员',
	        avatar: "http://www.ikongji.com/uc_server/images/avatar/avatar_1_middle.gif",
	        talk_status: 1,
	    },
	];


    // foo('set_admin');
    // foo('set_talk_status');
    foo('del_member');

    function foo(from) {
        var html = doT_Render('#tpl-group-manage-'+from, window.mockGroupMembers);
        var dom = $api.byId('group-manage');
        $api.data(dom, 'from', from);
    	$api.append(dom, html);
    }
</script>
